<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>关爱筹后台管理系统</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/layui/css/layui.css" />
<link rel="stylesheet" href="/layui/css/login.css" />
<style type="text/css">

	html {
    background-color: #f2f2f2;
    color: #666;
}

</style>
<script src="/plugins/jquery/jquery-1.10.2.min.js"></script>
<script src="/layui/layui.js"></script>
<script src="/plugins/js/common.js"></script>
<script type="text/javascript" th:inline="javascript">
	layui.use(['form','layer'], function () {
		if(!isNull([[${loginFailed}]])){
			layer.msg([[${loginFailed}]],{icon: 5});
		}
	    // 操作对象
	    var form = layui.form;
	    form.on('submit(login)',function (data) {
	        return false;
	    })
	});
	
	function login(){
		if(isNull($("#userName").val())){
			layer.msg('请输入用户名', {icon: 5});
			return;
		}
		if(isNull($("#password").val())){
			layer.msg('请输入密码', {icon: 5});
			return;
		}
		$("#loginForm").submit();
	}
	
	$(document).keyup(function(event){
		  if(event.keyCode ==13){
			  login();
		  }
		});
	
</script>
</head>
<body>
<div class="login-main">
    <header class="layui-elip">关爱筹后台管理系统</header><br>
    <form class="layui-form" method="post" id="loginForm" action="/user/login">
        <div class="layui-input-inline">
            <input type="text" name="userName" id="userName" required lay-verify="required" placeholder="请输入用户名" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="password" name="password" id="password" l required lay-verify="required" placeholder="请输入密码" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline login-btn">
        	<br>
            <input type="button"  lay-filter="login" onclick="login();" class="layui-btn" value="登录">
        </div>
        <hr/>
    </form>
</div>
</body>
</html>